約 6,189,988 件
https://w.atwiki.jp/opengles/pages/30.html
GL types are not C types. GL Type Minimum Bit Width Description boolean 1 Boolean byte 8 Signed binary integer ubyte 8 Unsigned binary integer char 8 Characters making up strings short 16 Signed 2’s complement binary integer ushort 16 Unsigned binary integer int 32 Signed 2’s complement binary integer uint 32 Unsigned binary integer fixed 32 Signed 2’s complement 16.16 scaled integer sizei 32 Non-negative binary integer size enum 32 Enumerated binary integer value intptr ptrbits Signed 2’s complement binary integer sizeiptr ptrbits Non-negative binary integer size bitfield 32 Bit field float 32 Floating-point value clampf 32 Floating-point value clamped to [0; 1]
https://w.atwiki.jp/shimizunochikara/pages/14.html
スティックコントローラーの機能 スティックを倒した方向に応じて、2つのキャタピラー出力に変換し無線送信する スティックを押す事で超信地旋回するモードとしないモードに切り替わる(超信地旋回するモードの場合には緑LEDが点灯) 車体から送られたデータを読み込み、値によって赤LEDを点灯する 一定時間データが送られてこない場合通信エラーなので赤LEDが点滅する 使用した部品 Arduino Fio XBee LiPoバッテリー アナログジョイスティック LED × 2(赤, 緑) ブレッドボード ハードウェアの説明 Arduinoのアナログ入力0, 1にジョイスティックのX軸とY軸を接続し、AD変換を行っている。また、D2ピンにボタンを接続し、スイッチが押された場合はGNDレベルに落ち、割り込みが発生するようになっている。D2ピンとスイッチに関しては 10KΩのプルアップ抵抗が取り付けられている。またD3とD5ピンにLEDが取り付けられており、PWMにより明るさの調整が可能になっている。 ソフトウェアの説明 XY座標により入力されるデータを2つのモーター出力に変換している。変換のために極座標に飛ばし、角度θにより左右のモーター出力の係数を出力する関数を記述し、それをベクトルの大きさRと掛け合わせる事でモーター出力を得ている。またスイッチによりモードの切り替えを行い、モード0(超信地旋回あり)とモード1(超信地旋回しない)で別の関数を呼び出している。データは現在100ms毎に送信を行っている。チャタリング対策に関してもソフトウェア的に行っている。一旦ボタンが押された場合は500ms割り込みを無視するように設定されている。データの送信を行うと、車体側から6系統のAD変換の結果が返ってくるので、そのデータの読み込みを行いA0の結果に応じて赤LEDを点灯する。また3秒以上データがかえってこない場合は通信エラーが発生しているため、赤LEDが点滅する。 実験 Arduino Tank Ver0.1と合わせて動作実験を行い、意図した通りに動作している事を確認した。ただし、通信エラーが発生する事がある。通信エラーはPCの近く等電磁波が発生していると考えられる場所、および走っている途中で発生している。 考察 現在通信エラーが発生してしまっているので、原因を確かめる必要がある。加えて、通信エラーが発生した際に復帰する機構を車体側も合わせ作成する必要がある。通信エラーの原因の特定するために通信モジュール、および車体側のモーターノイズや電圧降下の程度を単体でテストを行う必要がある。 今後の課題 通信モジュールのテスト(どういった場合にエラーが発生するか) //ソースコード polar_stick_ver4#include MsTimer2.h #include math.h #define MAX_X 1012#define MAX_Y 998#define MIN_X 0#define MIN_Y 0#define NEUTRAL_X 414#define NEUTRAL_Y 422#define asobi 20#define STICK_LED 3#define DATA0_PIN 5 unsigned long MainTimerCount;/*TimerCount1 データの送信周期用TimerCount2 スティックボタンのチャタリング対策用TimerCount3 errorLed用TimerCount4 受信データが途切れていないかの確認用error_flag flagが1の場合はエラーなので, error_led関数がenableになる*/unsigned long TimerCount1, TimerCount2, TimerCount3, TimerCount4;int stick_mode, error_flag, error_led_mode; /*通信が不安定になった場合に実行する*/void XBee_abort(int second){ int i; make_command(0, 0); for(i = 0; i second; i++){ make_command(0, 0); delay(1000); Serial.flush(); }} void timer_interrupt(){ int i; double r, s; int left_power, right_power;//-255 ~ 255でモーター出力を表現 if(MainTimerCount - TimerCount1 = 10){//データの送信 stick_read( r, s);//極座標で値を返す関数 if(stick_mode == 0) convert_pwm2(r,s, left_power, right_power); else if(stick_mode == 1) convert_pwm(r,s, left_power, right_power); make_command(left_power, right_power); TimerCount1 = MainTimerCount; } error_led(); //タイマーの加算 MainTimerCount++;} //errorLedを点灯させる関数void error_led(){ if(error_flag == 1){ if(MainTimerCount - TimerCount3 = 50){ if(error_led_mode == 0){ analogWrite(DATA0_PIN,50); error_led_mode = 1; } else{ analogWrite(DATA0_PIN, 0); error_led_mode = 0; } TimerCount3 = MainTimerCount; } }} void button_interrupt(){ if(MainTimerCount - TimerCount2 = 50){ if(stick_mode == 0){ stick_mode = 1; analogWrite(STICK_LED, 255); } else{ stick_mode = 0; analogWrite(STICK_LED, 0); } TimerCount2 = MainTimerCount; }} void setup(){ Serial.begin(9600); pinMode(STICK_LED, OUTPUT); pinMode(DATA0_PIN, OUTPUT); MainTimerCount = 0; TimerCount1 = 0; TimerCount2 = 0; TimerCount3 = 0; TimerCount4 = 0; error_flag = 0; attachInterrupt(0, button_interrupt, FALLING); MsTimer2 set(10, timer_interrupt); MsTimer2 start(); attachInterrupt(0, button_interrupt, FALLING); stick_mode = 0; digitalWrite(STICK_LED, LOW); analogWrite(DATA0_PIN, 0);} /*rは中央からの距離, sは角度を表す. rの最大は1である.sはスティックを前に倒すと0, 左に倒すと-90, 右に倒すと90, 後ろに倒すと180 or -180を返す*/void stick_read(double *r, double *s){ double stick_x, stick_y; //スティック位置の補正 stick_x = (double)analogRead(0); stick_y = (double)analogRead(1); if(stick_x NEUTRAL_X){ stick_x = (stick_x - NEUTRAL_X) / (NEUTRAL_X - MIN_X); } else{ stick_x = (stick_x - NEUTRAL_X) / (MAX_X - NEUTRAL_X); } if(stick_y NEUTRAL_Y){ stick_y = (stick_y -NEUTRAL_Y) / (NEUTRAL_Y - MIN_Y); } else{ stick_y = (stick_y - NEUTRAL_Y)/ (MAX_Y - NEUTRAL_Y); } /* デバッグ用 Serial.print(stick_x); Serial.print(","); Serial.println(stick_y); */ *r = sqrt(pow(stick_x,2) + pow(stick_y, 2)); if(*r 1)*r = 1; else if(*r -1)*r = -1; *s = atan2(stick_x, stick_y) /3.14 * 180;}/*極座標による入力を二つのモーターの出力に変換する関数. 超信地展開するバージョン. moterの出力は-255 ~ 255である. -は逆回転を表す*/void convert_pwm(double r, double s, int *lp, int *rp){ double _lp, _rp; if(-180 = s s -90){ _lp = -1; _rp = (s + 180) / 45 - 1; } else if(-90 = s s 0){ _lp = (s + 90) / 45 - 1; _rp = 1; } else if(0 = s s 90){ _lp = 1; _rp = 1 - s / 45; } else{//90 = r = 180の時 _lp = 1 - (s - 90) / 45; _rp = -1; } *lp = _lp * r * 255; *rp = _rp * r * 255; if(abs(*lp) 20)*lp = 0;if(abs(*rp) 20)*rp = 0; /*デバグ用 Serial.print(_lp); Serial.print(","); Serial.println(_rp); */}/*極座標による入力を二つのモーターの出力に変換する関数. 超信地展開しないバージョン. moterの出力は-255 ~ 255である. -は逆回転を表す*/void convert_pwm2(double r, double s, int *lp, int *rp){ double _lp, _rp; if(-180 = s s -90){ _lp = (s + 180) / 90 - 1; _rp = (s + 180) / 45 - 1; } else if(-90 = s s 0){ _lp = (s + 90) / 90; _rp = 1; } else if(0 = s s 90){ _lp = 1; _rp = 1 - s / 90; } else{//90 = r = 180の時 _lp = 1 - (s - 90) / 45; _rp = -1 * (s - 90) / 90; } *lp = _lp * r * 255; *rp = _rp * r * 255; if(abs(*lp) 20)*lp = 0;if(abs(*rp) 20)*rp = 0; /*デバグ用 Serial.print(_lp); Serial.print(","); Serial.println(_rp); */} void make_command(int left_power, int right_power){ char c0, c1, c2, c3; left_power += 255; right_power += 255; c0 = (left_power 0b111111100) 2; c1 = (left_power 0b000000011) 5; c1 = c1 | ((right_power 0b111110000) 4); c2 = (right_power 0b000001111) 3; c3 = 0; c0 = c0 | 0b10000000;//先頭バイトの先頭ビットを1とする c0 = c0 0b111111111; Serial.print(c0); Serial.print(c1); Serial.print(c2); Serial.print(c3);} void loop(){ int i, b; char c[12]; int data[6]; if(MainTimerCount - TimerCount4 = 100){ error_flag = 1; XBee_abort(3); error_flag = 0; make_command(0, 0); delay(50); TimerCount4 = MainTimerCount; } //データの読み込み if(Serial.available()){ c[0] = Serial.read(); if((c[0] 0b10000000) != 0){ delay(30); for(i = 1 ; i 12; i++) c[i] =Serial.read(); for(i = 0; i 6; i++){ data[i] = c[i * 2] 0b01111111; data[i] = data[i] 3; data[i] = data[i] | c[i * 2 + 1] 0b00000111; } b = data[0] / 4 - 100; if(b 0)b = 0; analogWrite(DATA0_PIN, b); TimerCount4 = MainTimerCount;//データが受信できているかを監視 } }}
https://w.atwiki.jp/android-reference/pages/23.html
public class Activity since API Level 1 extends ContextThemeWrapper implements ComponentCallbacks KeyEvent.Callback Layoutlnflater.Factory View.OnCreateContextMenuListener Window.Callback java.lang.Object ↳ android.content.Context ↳ android.content.ContextWrapper ↳ android.view.ContextThemeWrapper ↳ android.app.Activity Known Direct Subclasses ActivityGroup, AliasActivity, ExpandableListActivity, ListActivity Known Indirect Subclasses LauncherActivity, PreferenceActivity, TabActivity Class Overview An activity is a single, focused thing that the user can do. Almost all activities interact with the user, so the Activity class takes care of creating a window for you in which you can place your UI with setContentView(View). While activities are often presented to the user as full-screen windows, they can also be used in other ways as floating windows (via a theme with windowIsFloating set) or embedded inside of another activity (using ActivityGroup). There are two methods almost all subclasses of Activity will implement onCreate(Bundle) is where you initialize your activity. Most importantly, here you will usually call setContentView(int) with a layout resource defining your UI, and using findViewById(int) to retrieve the widgets in that UI that you need to interact with programmatically. onPause() is where you deal with the user leaving your activity. Most importantly, any changes made by the user should at this point be committed (usually to the ContentProvider holding the data). To be of use with Context.startActivity(), all activity classes must have a corresponding activity declaration in their package s AndroidManifest.xml. The Activity class is an important part of an application s overall lifecycle, and the way activities are launched and put together is a fundamental part of the platform s application model. For a detailed perspective on the structure of Android applications and lifecycles, please read the Dev Guide document on Application Fundamentals.
https://w.atwiki.jp/cadencii_en/pages/53.html
English 日本語 Release Note Release Date 30 May, 2009 Notes Cadencii requires ".NET Framework Runtime(version 2.0 or later)" and "Visual C++ Library DLLs". Installers of these rumtimes are available from the links below. .NET Framework Runtime Download .NET Framework 3.5 SP1 Visual C++ Library DLL Microsoft Visual C++ 2008 Redistributable Package (x86) Cadencii can be launched with the latest version of mono. This enable you to use Cadencii with many platforms supported by mono. (Note Several functions using VOCALOID2 VSTi are not available in this case.) Mono is available from the link mono download Download Cadencii version 2.0.0 (568KB) CadenciiSDK version 2.0 (455KB) How to get source codes Source code is available on SourceForege.JP. Please follow the instruction below for checking out the SourceForge.JP s SVN repository. svn checkout -r 205 http //svn.sourceforge.jp/svnroot/cadencii/branches/2.0 ./ These cvs / svn command is for checiking out "THIS" version of Cadencii. In order to get the latest source codes, please remove "-r" options from these commands.
https://w.atwiki.jp/nwwiki/pages/102.html
概要 2024/1/10に実装される「NewWorld Update 4.0.2」の日本語翻訳です。 目次 アップデート内容 LEGACY OF CRASSUS 1月のストアショーケース ハウジングコンテスト リリースノートワールドエクスペリエンス アップデート内容 メンテナンス日時:1月10日(水)16 00 ~ 17 00(日本時間) 原文:https //www.newworld.com/en-us/news/articles/new-world-update-4-0-2 LEGACY OF CRASSUS 1月10日から23日にかけて、ローマの暴虐の影がゆっくりとエターナムを飲み込もうと迫ってきています。 特定のイベントでデイリー報酬のために「General Crassus's monstrous captains」を追い出しましょう。 「Brightwood」、「Weavers Fen」、「 Mourningdale」「Ebonscale Reach」と「Edengrove」で、 共和国の旗を引き下ろす勇気あるプレイヤーは、サイクロプスのスタチューやネームド装備などを獲得することができます。 1月のストアショーケース youtubehttps //www.youtube.com/watch?v=p4-J4invYvE ab_channel=PlayNewWorld) ハウジングコンテスト リリースノート 重装のスタミナコストが50から55に増加しました。 弓 ・PvEでのベースダメージが「2.8%」増加しました。 ・「Empowering Explosive Arrow 」のツールチップを更新し、攻撃だけでなく次のヒットで削除されることが より明確になりました。また、エンパワーの持続時間を10秒 → 5秒に短縮しました。 マスケット ・PvEでのマスケットのベースダメージを「4.8%」増加しました。 Pestilence Artifact ・「outgoing healing」減少効果がスタックごとに 5% → 2.5% に減少しました。 Koya's Knee Guards ・ダメージ軽減が10%から13%に増加しました。 ボイド・ガントレット ・ヴォイドブレードの攻撃ダメージの増加 ・弱攻撃のダメージが90% → 100% ・強攻撃のダメージが140% → 150% ファイアスタッフ ・アビリティ使用中のの移動速度が 3.25m/s → 2.75m/s (約15%減少)に減少しました。 ・Empowering Fireball - 62% → 58% に減少しました。 Hearty ・10%よりも多くのスタミナを提供する不具合を修正しました。 フレイル ・Deflecting Frailtyの効果が味方に適用されない不具合を修正しました。 ワールドエクスペリエンス 大および中サイズのオリハルコン生成地点に関する変更を元に戻し、採掘した跡が残存しない不具合を修正しました。 レイドグループによって作られたキャンプは、グループのプレイヤーだけでなく、誰でも使用できるようになりました。 「Winter Convergence Festival」が終了しました。一緒に祝ってくれた皆さん、ありがとうございました! 注目すべき修正 「Commander Loth」のボス戦において、巨大なアイス・エレメンタルにダメージを与えることでエンカウンターが壊れる不具合を修正しました。 「Glacial Tarn」の「Ser Milosh」が戦利品を落とさない不具合を修正しました。 「Mordred」が環境を通り抜ける原因となる不具合を修正しました。 3つのクエスト報酬キャラクターが固有の外見ではなく一般的なNPCとして生成される不具合を修正しました。 レイドグループに変換する際の稀なサーバークラッシュを修正しました。 「Cleansing Treasure」クエストが「Complete Repeatable Expedition Quests」シーズンジャーニーとしてカウントされない不具合を修正しました。 「Winter Convergence skins」の視覚的なバグを修正しました。 「Syndicate Faction」クエストの達成者が他の派閥に切り替えた後に「Syndicate」に再加入できない不具合を修正しました。 サポートいただきありがとうございます!エターナムでお会いしましょう。
https://w.atwiki.jp/lockerroom/pages/14.html
/* COM操作ライブラリby 流行らせるページ管理人 Ver 3β */ ActiveX(){ global IID_IDispatch =GUID("{00020400-0000-0000-C000-000000000046}") IID_IUnknown =GUID("{00000000-0000-0000-C000-000000000046}") IID_NULL =GUID("{00000000-0000-0000-0000-000000000000}") IID_IConnectionPointContainer =GUID("{B196B284-BAB4-101A-B69C-00AA00341D07}") IID_IProvideClassInfo =GUID("{B196B283-BAB4-101A-B69C-00AA00341D07}") ;IID_IProvideClassInfo2 =GUID("{A6BC3AC0-DBAA-11CE-9DE3-00AA004BB851}") LOCALE_USER_DEFAULT =DllCall("kernel32.dll¥GetUserDefaultLCID") CoInitialize() } /* ********************************** 汎用メモリ管理 ********************************** */ ;メモリを確保しポインタを返す Malloc(size,flag=0x40){ return DllCall("kernel32.dll¥GlobalAlloc","UInt",flag,"UInt",size,"UInt") } ;ポインタで指定されたメモリを解放する Free(p){ DllCall("kernel32.dll¥GlobalFree",UInt,p,UInt) } /* ********************************** GUID関連 ********************************** */ ;CLSID文字列からGUID構造体を生成しアドレスを得る(仮) GUID(string){ size =DllCall("kernel32.dll¥MultiByteToWideChar","UInt",0,"UInt",0,"Str",string,"Int",-1,"UInt",0,"Int",0) wstr =Malloc((size+1)*2) DllCall("kernel32.dll¥MultiByteToWideChar","UInt",0,"UInt",0,"Str",string,"Int",-1,"UInt",wstr,"Int",(size+1)*2) ptr =Malloc(16) DllCall("ole32.dll¥CLSIDFromString","UInt",wstr,"UInt",ptr) Free(wstr) return ptr } ;ProgID文字列からGUID構造体を生成しアドレスを得る(仮) ProgID(string){ size =DllCall("kernel32.dll¥MultiByteToWideChar","UInt",0,"UInt",0,"Str",string,"Int",-1,"UInt",0,"Int",0) wstr =Malloc((size+1)*2) DllCall("kernel32.dll¥MultiByteToWideChar","UInt",0,"UInt",0,"Str",string,"Int",-1,"UInt",wstr,"Int",(size+1)*2) ptr =Malloc(16) DllCall("ole32.dll¥CLSIDFromProgID","UInt",wstr,"UInt",ptr) Free(wstr) return ptr } ;GUID構造体を文字列に変換 fromGUID(ByRef guid){ ptr =Malloc(80) DllCall("ole32.dll¥StringFromGUID2","UInt",guid,"UInt",ptr,"Int",80) res =wc2mb(ptr) Free(ptr) return res } /* ********************************** Unicode関連 ********************************** */ ;文字列からにUnicodeへの変換を行う ;返り値はUnicode文字列へのポインタ mb2wc(mbstr){ size =(DllCall("kernel32.dll¥MultiByteToWideChar","UInt",0,"UInt",0,"Str",mbstr,"Int",-1,"UInt",0,"Int",0)+1)*2 wstr =Malloc(size) DllCall("kernel32.dll¥MultiByteToWideChar","UInt",0,"UInt",0,"Str",mbstr,"Int",-1,"UInt",wstr,"Int",size) return wstr } mb2wc_ref(ByRef mbstr){ size =(DllCall("kernel32.dll¥MultiByteToWideChar","UInt",0,"UInt",0,"Str",mbstr,"Int",-1,"UInt",0,"Int",0)+1)*2 wstr =Malloc(size) DllCall("kernel32.dll¥MultiByteToWideChar","UInt",0,"UInt",0,"Str",mbstr,"Int",-1,"UInt",wstr,"Int",size) return wstr } ;UnicodeからAnsi文字列への変換を行う ;返り値は文字列 wc2mb(wstr){ size =DllCall("kernel32.dll¥WideCharToMultiByte","UInt",0,"UInt",0,"UInt",wstr,"Int",-1,"UInt",0,"Int",0,"UInt",0,"UInt",0) VarSetCapacity(mbstr,size) DllCall("kernel32.dll¥WideCharToMultiByte","UInt",0,"UInt",0,"UInt",wstr,"Int",-1,"Str",mbstr,"Int",size,"UInt",0,"UInt",0) return mbstr } wc2mb_ref(wstr,ByRef mbstr){ size =DllCall("kernel32.dll¥WideCharToMultiByte","UInt",0,"UInt",0,"UInt",wstr,"Int",-1,"UInt",0,"Int",0,"UInt",0,"UInt",0) VarSetCapacity(mbstr,size) DllCall("kernel32.dll¥WideCharToMultiByte","UInt",0,"UInt",0,"UInt",wstr,"Int",-1,"Str",mbstr,"Int",size,"UInt",0,"UInt",0) return size } /* ********************************** COM汎用 ********************************** */ CoInitialize(){ return DllCall("ole32.dll¥CoInitialize","UInt",0,"UInt") } CoUninitialize(){ return DllCall("ole32.dll¥CoUninitialize","UInt",0,"UInt") } OleInitialize(){ return DllCall("ole32.dll¥OleInitialize","UInt",0,"UInt") } OleUninitialize(){ return DllCall("ole32.dll¥OleUninitialize","UInt",0,"UInt") } CoTaskMemAlloc(size){ return DllCall("ole32.dll¥CoTaskMemAlloc","UInt",size,"UInt") } CoTaskMemFree(ptr){ return DllCall("ole32.dll¥CoTaskMemFree","UInt",ptr,"UInt") } M(ByRef ip,idx=0){ return NumGet(NumGet(ip+0)+4*idx) } QueryInterface(pObj,strIID=""){ global IID_IDispatch guid =0 if(strIID=""){ IID =IID_IDispatch }else if(StrLen(strIID)=38){ IID =GUID(strIID) }else{ IID =strIID } res =0 ErrorLevel =DllCall(M(pObj,0),"UInt",pObj,"UInt",IID,"UIntP",res) return res } AddRef(pObj){ if(pObj){ DllCall(M(pObj,1),"UInt",pObj) } return pObj } Release(pObj){ if(pObj){ return DllCall(M(pObj,2),"UInt",pObj) } } ReleaseL(p1,p2=-1,p3=-1,p4=-1,p5=-1,p6=-1,p7=-1,p8=-1,p9=-1){ format =A_FormatInteger SetFormat,Integer,D Loop,10{ if(p%A_Index%!=-1){ Release(p%A_Index%) } } SetFormat,Integer,%format% } /* ********************************** VARIANT関連 ********************************** */ ;Ansi文字列をBSTR形式に変換する toBSTR(str){ oc =mb2wc(str) res =DllCall("oleaut32.dll¥SysAllocString","UInt",oc,"UInt") Free(oc) return res } ;BSTRをAnsi文字列に変換する fromBSTR(bstr){ return wc2mb(bstr) } ;BSTRを解放する(VariantClear内でやってくれるはずなので多分不要) freeBSTR(bstr,get=0){ if(get!=0){ wc2mb_ref(bstr,res) }else{ res= } DllCall("oleaut32.dll¥SysFreeString","UInt",bstr) return res } vNull(){ return 0x7FFFFFFF00000000 } vObj(obj){ return 0x7FFFFFFF00000000 | obj } ;VARIANTに変換(typeには変換したい型を指定 ;settypeを指定すると、型変換した上で、型を示す値としてsettypeで指定した型を格納する toVariant(value,variant=0,type=0x08,settype=-1){ global LOCALE_USER_DEFAULT ;格納先初期化 if(variant=0){ dest =Malloc(16) }else{ dest =variant } DllCall("oleaut32.dll¥VariantInit","UInt",dest) if(type=0x08){ if(value 32 = 0x7FFFFFFF){ if(value-0x7FFFFFFF00000000=0){ ;VT_NULL NumPut(0x01,dest+0,0,"UShort") }else{ ;VT_DISPATCH NumPut(0x09,dest+0,0,"UShort") NumPut(value - 0x7FFFFFFF00000000,dest+8,0) } }else{ ;文字列の場合 NumPut(0x08,dest+0,0,"UShort") NumPut(toBSTR(value),dest+8,0) } }else{ ;それ以外の型の場合 tmp =toVariant(value) DllCall("oleaut32.dll¥VariantChangeTypeEx","UInt",dest,"UInt",tmp,"UInt",LOCALE_USER_DEFAULT,"UShort",0,"UShort",type) if(settype!=-1){ NumPut(settype,dest+0,0,"UShort") } vFree(tmp) } return dest } ;VARIANTに格納された内容を通常のAutoHotkey変数として取得 ;rawsizeが1,2,4の場合、格納されている生の値を取得 ;rawsizeが0の場合、文字列に変換して取得 fromVariant(var,rawsize=0){ global LOCALE_USER_DEFAULT if(rawsize=0){ type =NumGet(var+0,0,"UShort") if((type=9)||(type=13)){ ;COMオブジェクト pObj =NumGet(var+8) AddRef(pObj) return pObj }else if(type 0xFF){ ;ポインタもしくは配列(暫定) return NumGet(var+8) }else{ ;VT_BSTRに変換 var2 =Malloc(16) DllCall("oleaut32.dll¥VariantInit","UInt",var2) DllCall("oleaut32.dll¥VariantChangeTypeEx","UInt",var2,"UInt",var,"UInt",LOCALE_USER_DEFAULT,"UShort",0,"UShort",0x8) ;値をAnsiに変換 wc2mb_ref(NumGet(var2+8),res) vFree(var2) return res } }else if(rawsize=1){ return NumGet(var+8,0,"UChar") }else if(rawsize=2){ return NumGet(var+8,0,"UShort") }else if(rawsize=4){ return NumGet(var+8) }else{ return fromVariant(var,0) } } ;VARIANTを解放(getに-1以外を指定すると、値を取得して返す) vFree(ByRef var,get=-1){ if(get!=-1){ res =fromVariant(var,get) }else{ res =0 } DllCall("oleaut32.dll¥VariantClear","UInt",var) Free(var) return res } /* ********************************** IDispatch用 ********************************** */ ;オブジェクトを生成する CreateObject(clsid,iid="",CLSCTX=5){;CLSCTX_SERVER global IID_IDispatch if(!IID_IDispatch){ ActiveX() } guid =0 if(RegExMatch(clsid,"^¥{[¥-0-9a-fA-F]{36}¥}$")){ guid =GUID(clsid) }else{ guid =ProgID(clsid) } if(iid=""){ iid2 =IID_IDispatch }else{ iid2 =GUID(iid) } ppRes =0 el =DllCall("ole32.dll¥CoCreateInstance","UInt",guid,"UInt",0,"UInt",CLSCTX,"UInt",iid2,"UIntP",ppRes,"UInt") Free(guid) if(iid2!=IID_IDispatch){ Free(iid2) } ErrorLevel =el return ppRes } ;objが持つnameメンバのDispatchIDを得る GetDispID(ByRef obj,name){ global IID_NULL,LOCALE_USER_DEFAULT wName =mb2wc_ref(name) dispid =0 DllCall(M(obj,5),"UInt",obj,"UInt",IID_NULL,"UIntP",wName,"UInt",1,"UInt",LOCALE_USER_DEFAULT,"UIntP",dispid,"UInt") Free(wName) return dispid } ;引数からDISPPARAMSを生成 CreateParam(ByRef p1, ByRef p2, ByRef p3, ByRef p4, ByRef p5, ByRef p6, ByRef p7, ByRef p8, ByRef p9, ByRef p10){ ;引数を数える(0xFFFFFFFFFFFFFFFFの前までが与えられた引数) num =0 format =A_FormatInteger SetFormat,Integer,D Loop,10{ if(p%A_Index%=0xFFFFFFFFFFFFFFFF){ break } num++ } ;num個のVARIANTARG配列を作成 if(num=0){ pvArgs =0 }else{ pvArgs =Malloc(16*num) ptr =pvArgs+16*(num-1) ;引数をセットしていく Loop,%num%{ toVariant(p%A_Index%,ptr) ptr-=16 } } SetFormat,Integer,%format% ;DISPPARAMS作成 res =Malloc(16) NumPut(pvArgs,res+0) NumPut(num,res+8) return res } ;DISPPARAMSを解放 FreeParam(ByRef params){ num =NumGet(params+8) pvArgs =NumGet(params+0) pvNArgs =NumGet(params+4) ;VARIANTARGの解放処理 ptr =pvArgs Loop,%num%{ vFree(ptr) ptr+=16 } ;VARIANTARG自体の解放 Free(ptr) ;rgdispidNamedArgsの解放 if(pvNArgs!=0){ Free(pvNArgs) } ;本体メモリ解放 Free(params) } Invoke(ByRef pObj,ByRef dispid,mode,ByRef params){ global IID_NULL,LOCALE_USER_DEFAULT pvRes =Malloc(16) DllCall("oleaut32.dll¥VariantInit",UInt,pvRes) DllCall(M(pObj,6),UInt,pObj,UInt,dispid,UInt,IID_NULL,UInt,LOCALE_USER_DEFAULT,UInt,mode,UInt,params,UInt,pvRes,UInt,0,UInt,0,UInt) return pvRes } inv(obj,name,p1=0xFFFFFFFFFFFFFFFF,p2=0xFFFFFFFFFFFFFFFF,p3=0xFFFFFFFFFFFFFFFF,p4=0xFFFFFFFFFFFFFFFF,p5=0xFFFFFFFFFFFFFFFF,p6=0xFFFFFFFFFFFFFFFF,p7=0xFFFFFFFFFFFFFFFF,p8=0xFFFFFFFFFFFFFFFF,p9=0xFFFFFFFFFFFFFFFF,p10=0xFFFFFFFFFFFFFFFF){ if((dispid =GetDispID(obj,name))!=0){ params =CreateParam(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) pvRes =Invoke(obj,dispid,1,params) FreeParam(params) return vFree(pvRes,0) } } gp(obj,name,p1=0xFFFFFFFFFFFFFFFF,p2=0xFFFFFFFFFFFFFFFF,p3=0xFFFFFFFFFFFFFFFF,p4=0xFFFFFFFFFFFFFFFF,p5=0xFFFFFFFFFFFFFFFF,p6=0xFFFFFFFFFFFFFFFF,p7=0xFFFFFFFFFFFFFFFF,p8=0xFFFFFFFFFFFFFFFF,p9=0xFFFFFFFFFFFFFFFF,p10=0xFFFFFFFFFFFFFFFF){ if((dispid =GetDispID(obj,name))!=0){ params =CreateParam(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) pvRes =Invoke(obj,dispid,2,params) FreeParam(params) return vFree(pvRes,0) } } pp(obj,name,p1=0xFFFFFFFFFFFFFFFF,p2=0xFFFFFFFFFFFFFFFF,p3=0xFFFFFFFFFFFFFFFF,p4=0xFFFFFFFFFFFFFFFF,p5=0xFFFFFFFFFFFFFFFF,p6=0xFFFFFFFFFFFFFFFF,p7=0xFFFFFFFFFFFFFFFF,p8=0xFFFFFFFFFFFFFFFF,p9=0xFFFFFFFFFFFFFFFF,p10=0xFFFFFFFFFFFFFFFF){ if((dispid =GetDispID(obj,name))!=0){ params =CreateParam(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) ;rgdispidNamedArgsのセット namedArgs =Malloc(4) NumPut(namedArgs,params+4) NumPut(0xFFFFFFFD,namedArgs+0) NumPut(1,params+12) pvRes =Invoke(obj,dispid,4,params) FreeParam(params) return vFree(pvRes) } } /* ********************************** イベントシンク用コールバック関数 ********************************** */ GuidIsEqual(guid1,guid2){ return DllCall("MSVCRT.dll¥memcmp","UInt",guid1,"UInt",guid2,"UInt",16)=0 } EVENTSINK_QueryInterface(pEv,iid,ppv){ global if(GuidIsEqual(iid,NumGet(pEv+8))||GuidIsEqual(iid,IID_IDispatch)||GuidIsEqual(iid,IID_IUnknown)){ NumPut(pEv,ppv+0) DllCall(M(pEv,1),"UInt",pEv) return 0 } NumPut(0,ppv+0) return 0x80004002 } EVENTSINK_AddRef(pEv){ cRef =NumGet(pEv+4) cRef++ NumPut(cRef,pEv+4) return cRef } EVENTSINK_Release(pEv){ cRef =NumGet(pEv+4) cRef-- NumPut(cRef,pEv+4) if(cRef==0){ EVENTSINK_Destructor(pEv) } return cRef } EVENTSINK_GetTypeInfoCount(pEv,pct){ NumPut(0,pct+0) return 0 } EVENTSINK_GetTypeInfo(pEv,info,lcid,pInfo){ return 0x8002000B;DISP_E_BADINDEX } EVENTSINK_GetIDsOfNames(pEv,riid,szNames,cNames,lcid,pDispID){ return 0x80020006;DISP_E_UNKNOWNNAME } EVENTSINK_Invoke(pEv,dispid,riid,lcid,wFlags,params,pvRes,exinf,argerr){ pTypeInfo =NumGet(pEv+24) ;GetNames hr =DllCall(M(pTypeInfo,7),"UInt",pTypeInfo, "UInt",dispid, "UIntP",bstr, "UInt",1, "UIntP",count) if(hr!=0){ return 0 } wc2mb_ref(bstr,ev) cb =GetOleEventCallback(NumGet(pEv+12),ev) if(cb){ DllCall(cb,"UInt",NumGet(pEv+28), "UInt",params, "UInt",pvRes) } } EVENTSINK_Constructor(){ static vtEventSink if(!vtEventSink){ vtEventSink =Malloc(28) NumPut(RegisterCallback("EVENTSINK_QueryInterface"),vtEventSink+0) NumPut(RegisterCallback("EVENTSINK_AddRef"),vtEventSink+4) NumPut(RegisterCallback("EVENTSINK_Release"),vtEventSink+8) NumPut(RegisterCallback("EVENTSINK_GetTypeInfoCount"),vtEventSink+12) NumPut(RegisterCallback("EVENTSINK_GetTypeInfo"),vtEventSink+16) NumPut(RegisterCallback("EVENTSINK_GetIDsOfNames"),vtEventSink+20) NumPut(RegisterCallback("EVENTSINK_Invoke"),vtEventSink+24) } pEv =Malloc(32) NumPut(vtEventSink,pEv+0) return pEv } EVENTSINK_Destructor(pEv){ Release(NumGet(pEv+28)) Free(pEv) } /* ********************************** コネクト用のインターフェイスIDを検索 ********************************** */ find_iid(ByRef obj,ByRef itf,ByRef iid,ByRef refPTypeInfo=0xFFFFFFFFFFFFFFFF){ global LOCALE_USER_DEFAULT ;GetTypeInfo hr =DllCall(M(disp,4),"UInt",obj, "UInt",0, "UInt",LOCALE_USER_DEFAULT, "UIntP",pTypeInfo) if(hr!=0){ return hr } ;GetContainingTypeLib hr =DllCall(M(pTypeInfo,18),"UInt",pTypeInfo, "UIntP",pTypeLib, "UIntP",index) Release(pTypeInfo) if(hr!=0){ return hr } if(!itf){ ;GetTypeInfoOfGuid hr =DllCall(M(pTypeLib,5),"UInt",pTypeLib, "UIntP",iid, "UIntP",refPTypeInfo) Release(pTypeLib) return hr } count =DllCall(M(pTypeLib,3),"UInt",pTypeLib);GetTypeInfoCount found =0 index =0 Loop,%count%{ hr =DllCall(M(pTypeLib,4),"UInt",pTypeLib, "UInt",index, "UIntP",pTypeInfo);GetTypeInfo if(hr!=0){ break } hr =DllCall(M(pTypeInfo,3),"UInt",pTypeInfo, "UIntP",pTypeAttr);GetTypeAttr if(hr!=0){ Release(pTypeInfo) break } if(NumGet(pTypeAttr+40)==5){;typekind==TKIND_COCLASS cTypes =NumGet(pTypeAttr+48,"UShort");cImplTypes type =0 Loop,%cTypes%{ hr =DllCall(M(pTypeInfo,8),"UInt",pTypeInfo, "UInt",type, "UIntP",RefType);GetRefTypeOfImplType if(hr!=0){ break } hr =DllCall(M(pTypeInfo,14),"UInt",pTypeInfo, "UInt",RefType, "UIntP",pImplTypeInfo);GetRefTypeInfo if(hr!=0){ break } ;GetDocumentation hr =DllCall(M(pImplTypeInfo,12),"UInt",pImplTypeInfo, "Int",-1, "UIntP",bstr, "UInt",0, "UInt",0, "UInt",0) if(hr!=0){ Release(pImplTypeInfo) break } wc2mb_ref(bstr,str) if(str==itf){ ;GetTypeAttr if(DllCall(M(pImplTypeInfo,3),"UInt",pImplTypeInfo, "UIntP",pImplTypeAttr)=0){ found =1 iid =Malloc(16) DllCall("kernel32.dll¥RtlMoveMemory", "UInt",iid, "UInt",pImplTypeAttr, "UInt",16) if(refPTypeInfo!=0xFFFFFFFFFFFFFFFF){ refPTypeInfo =pImplTypeInfo AddRef(pImplTypeInfo) } ;ReleaseTypeAttr DllCall(M(pImplTypeInfo,3),"UInt",pImplTypeInfo, "UInt",pImplTypeAttr) } } Release(pImplTypeInfo) if(found||(hr!=0)){ break } type++ } } hr =DllCall(M(pTypeInfo,3),"UInt",pTypeInfo, "UInt",pTypeAttr);ReleaseTypeAttr Release(pTypeInfo) if(found||(hr!=0)){ break } index++ } Release(pTypeLib) if(!found){ return 0x80004002 }else{ return hr } } find_default_source(ByRef obj,ByRef iid,ByRef refPTypeInfo){ global IID_IProvideClassInfo;,IID_IProvideClassInfo2 /* pProvideClassInfo2 =QueryInterface(obj,IID_IProvideClassInfo2) if(ErrorLevel________==0){ ;GetGUID hr =DllCall(M(pProvideClassInfo2,4),"UInt",pProvideClassInfo2, "UInt",1, "UIntP",iid) Release(pProvideClassInfo2) return find_iid(obj,"",iid,refPTypeInfo) } */ pProvideClassInfo =QueryInterface(obj,IID_IProvideClassInfo) if(ErrorLevel!=0){ return ErrorLevel } ;GetClassInfo hr =DllCall(M(pProvideClassInfo,3),"UInt",pProvideClassInfo, "UIntP",pTypeInfo) Release(pProvideClassInfo) if(hr!=0){ return hr } ;GetTypeAttr hr =DllCall(M(pTypeInfo,3),"UInt",pTypeInfo, "UIntP",pTypeAttr) if(hr!=0){ Release(pTypeInfo) return hr } cTypes =NumGet(pTypeAttr+48,"UShort");cImplTypes type =0 Loop,%cTypes%{ hr =DllCall(M(pTypeInfo,9),"UInt",pTypeInfo, "UInt",type, "UIntP",iFlags);GetImplTypeFlags if(hr!=0){ continue } if((iFlags 0x3)=0x3){;((iFlags IMPLTYPEFLAG_FDEFAULT) (iFlags IMPLTYPEFLAG_FSOURCE)) hr =DllCall(M(pTypeInfo,8),"UInt",pTypeInfo, "UInt",type, "UIntP",RefType);GetRefTypeOfImplType if(hr!=0){ continue } hr =DllCall(M(pTypeInfo,14),"UInt",pTypeInfo, "UInt",RefType, "UIntP",refPTypeInfo);GetRefTypeInfo if(hr!=0){ break } } type++ } DllCall(M(pTypeInfo,3),"UInt",pTypeInfo, "UInt",pTypeAttr);ReleaseTypeAttr Release(pTypeInfo) if(!refPTypeInfo){ if(hr==0){ return 0x8000FFFF }else{ return hr } } if(DllCall(M(refPTypeInfo,3),"UInt",refPTypeInfo, "UIntP",pTypeAttr)=0){;GetTypeAttr iid =Malloc(16) DllCall("kernel32.dll¥RtlMoveMemory", "UInt",iid, "UInt",pTypeAttr, "UInt",16) DllCall(M(refPTypeInfo,3),"UInt",refPTypeInfo, "UInt",pTypeAttr);ReleaseTypeAttr }else{ Release(refPTypeInfo) refPTypeInfo ="" } return hr } EntryOleEventPrefix(ByRef prefix){ global static OleEventCount=0 if(OleEventID_%prefix%){ return OleEventID_%prefix% }else{ OleEventID_%prefix% =OleEventCount OleEventPrefix_%OleEventCount% =prefix return OleEventCount++ } } GetOleEventCallback(id,ByRef evt){ global local prefix,cb prefix =OleEventPrefix_%id% if(prefix){ if(OleEventCallback_%prefix%%evt%){ return OleEventCallback_%prefix%%evt% } cb =RegisterCallback(prefix . evt) if(cb){ OleEventCallback_%prefix%%evt% =cb return cb } } } ConnectObject(obj,prefix,itf=0xFFFFFFFFFFFFFFFF){ global IID_IConnectionPointContainer if(itf==0xFFFFFFFFFFFFFFFF){ hr =find_default_source(obj,iid,pTypeInfo) }else{ hr =find_iid(obj,itf,iid,pTypeInfo) } if(hr!=0){ ErrorLevel =hr return 0 } pContainer =QueryInterface(obj,IID_IConnectionPointContainer) if(ErrorLevel!=0){ Release(pTypeInfo) return 0 } ;FindConnectionPoint hr =DllCall(M(pContainer,4),"UInt",pContainer, "UInt",iid, "UIntP",pConnectionPoint) Release(pContainer) if(hr!=0){ Release(pTypeInfo) return 0 } pIEV =EVENTSINK_Constructor() NumPut(iid,pIEV+8) ;Advise hr =DllCall(M(pConnectionPoint,5),"UInt",pConnectionPoint, "UInt",pIEV, "UIntP",dwCookie) if(hr!=0){ return 0 } AddRef(obj) evid =EntryOleEventPrefix(prefix) NumPut(evid,pIEV+12) NumPut(dwCookie,pIEV+16) NumPut(pConnectionPoint,pIEV+20) NumPut(pTypeInfo,pIEV+24) NumPut(obj,pIEV+28) } evArgc(ByRef para){ return NumGet(para+8) } evArgv(ByRef para,idx){ num =NumGet(para+8) if(idx num){ return fromVariant(NumGet(para+0)+(num-1-idx)*16) } } evReturn(ByRef res,value){ toVariant(value,res) } /* ********************************** ディスパッチオブジェクト作成 ********************************** */ DISPATCH_QueryInterface(ptr,iid,ppv){ global if(GuidIsEqual(iid,IID_IDispatch)||GuidIsEqual(iid,IID_IUnknown)){ NumPut(ptr,ppv+0) DllCall(M(ptr,1),"UInt",ptr) return 0 }else{ NumPut(0,ppv+0) return 0x80004002 } } DISPATCH_AddRef(ptr){ cRef =NumGet(ptr+4) cRef++ NumPut(cRef,ptr+4) return cRef } DISPATCH_Release(ptr){ cRef =NumGet(ptr+4) cRef-- NumPut(cRef,ptr+4) if(cRef==0){ Free(ptr) } return cRef } DISPATCH_GetTypeInfoCount(ptr,pct){ NumPut(0,pct+0) return 0 } DISPATCH_GetTypeInfo(ptr,info,lcid,pInfo){ return 0x8002000B;DISP_E_BADINDEX } DISPATCH_GetIDsOfNames(ptr,riid,pszNames,cNames,lcid,pDispID){ wc2mb_ref(NumGet(pszNames+0),name) hr =GetOleMethodCallback(NumGet(ptr+12),name,cb) NumPut(cb,pDispID+0) return hr } DISPATCH_Invoke(ptr,dispid,riid,lcid,wFlags,params,pvRes,exinf,argerr){ DllCall(dispid,"UInt",ptr, "UInt",params, "UInt",pvRes, "UInt",wFlags) return 0 } EntryOleMethodsPrefix(ByRef prefix,ByRef id){ global static OleMethodsCount=0 if(OleMethodsID_%prefix%){ id =OleMethodsID_%prefix% }else{ OleMethodsID_%prefix% =OleMethodsCount OleMethodsPrefix_%OleMethodsCount% =prefix id =OleMethodsCount++ } } GetOleMethodCallback(id,ByRef name,ByRef cb){ global local prefix cb =0 prefix =OleMethodsPrefix_%id% if(prefix){ if(OleMethodCallback_%prefix%%name%){ cb =OleMethodCallback_%prefix%%name% return 0 }else{ cb =RegisterCallback(prefix . name) if(cb){ OleMethodCallback_%prefix%%name% =cb return 0 }else{ return 0x80020006 } } } } CreateDispatchObject(prefix,exsize=0){ global IID_IDispatch static vtDispatch if(!vtDispatch){ vtDispatch =Malloc(28) NumPut(RegisterCallback("DISPATCH_QueryInterface"),vtDispatch+0) NumPut(RegisterCallback("DISPATCH_AddRef"),vtDispatch+4) NumPut(RegisterCallback("DISPATCH_Release"),vtDispatch+8) NumPut(RegisterCallback("DISPATCH_GetTypeInfoCount"),vtDispatch+12) NumPut(RegisterCallback("DISPATCH_GetTypeInfo"),vtDispatch+16) NumPut(RegisterCallback("DISPATCH_GetIDsOfNames"),vtDispatch+20) NumPut(RegisterCallback("DISPATCH_Invoke"),vtDispatch+24) } EntryOleMethodsPrefix(prefix,id) ptr =Malloc(12+exsize) NumPut(vtDispatch,ptr+0) NumPut(IID_IDispatch,ptr+8) NumPut(id,ptr+12) return ptr }
https://w.atwiki.jp/0x0b/pages/38.html
字句 7 字句について (Lexical Convention) ECMAScript プログラムのソーステキストは最初に、トークン、行終端子、コメントあるいは空白のいずれかである入力要素のシーケンスに変換される。ソーステキストは、次の入力要素としてできるだけ長い文字シーケンスを繰り返しとって、左から右へと走査される。 字句文法には 2 つの目標記号がある。 InputElementDiv 記号は、除法演算子 (/) また除法代入演算子 (/=) が許される構文的文法コンテキストで使用される。 InputElementRegExp 記号は他の構文的文法コンテキストで使用される。 NOTE 構文的な文法内に、除算および RegularExpressionLiteral の両方が構文的文法によって許されるコンテキストが存在する; だが、そういう場合字句文法は InputElementDiv 目標記号を使用するので、そのコンテキスト中でスラッシュ開始は正規表現リテラル開始とは認められない。代替手段として、一つは括弧で正規表現リテラルを囲んでよい。 Syntax InputElementDiv WhiteSpace LineTerminator Comment Token DivPunctuator InputElementRegExp WhiteSpace LineTerminator Comment Token RegularExpressionLiteral 7.1 Unicode 制御文字 (Unicode Format-Control Characters) フォーマット制御のための (マークアップ言語のような) 上位手順がないので、 Unicode 形式制御文字 (例 LEFT-TO-RIGHT MARK や RIGHT-TO-LEFT MARK のような、 Unicode 文字データベース (Unicode Character Database) における "Cf" カテゴリの文字) という制御コードでテキストの範囲のフォーマットを制御する。編集を容易にしまた表示するため、ソーステキスト内でのこれらの許可は有益である。 フォーマット制御文字は ECMAScript プログラムのソーステキストのどの場所に出現してもよい。これらの文字は、字句文法を適用する前にソーステキストから取り除かれる。文字列と正規表現リテラルの処理前にこれらの文字が取り除かれるので、文字列、正規表現内に Unicode 制御文字を入れるには Unicode エスケープシーケンス (セクション 7.6) を使用しなければならない。 7.2 空白 (White Space) 空白文字は、ソーステキストの可読性を向上させ、そしてトークン (不可分の字句単位) を互いに分離させるために使用され、それ以上の意味はない。空白は 2 つのトークンの間、また文字列の中に出現できる(リテラル文字列値の一部を形成する意味のある文字と考えられる)。だが、トークンの中に出現することは出来ない。 次の文字が空白と考えられる Code Point ValueNameFormal Name \u0009Tab TAB \u000BVertical Tab VT \u000CForm Feed FF \u0020Space SP \u00A0No-break space NBSP Other category "Zs"その他の Unicode "space separator" USP Syntax WhiteSpace TAB VT FF SP NBSP USP 7.3 行終端子 (Line Terminators) 空白文字のように、行終端子はソーステキストの可読性を向上させ、そしてトークン (不可分の字句単位) を互いに分離させるために使用される。しかし、空白文字とは違い、行終端子は構文的文法の振る舞いに影響を与える。一般に、行終端子は 2 のトークンの間に出現する。だが構文的文法によって隠される場所がある。行終端子はトークンの中に出現することは出来ない。 not even a string. 行終端子は自動セミコロン挿入の処理にも影響を与える (セクション 7.9)。 空白は 2 つのトークンの間、また文字列の中に出現できる(リテラル文字列値の一部を形成する意味のある文字と考えられる)。だが、トークンの中に出現することは出来ない。 次の文字が行終端子と考えられる Code Point ValueNameFormal Name \u000ALine Feed LF \u000DCarriage Return CR \u2028Line separator LS \u2029Paragraph separator PS Syntax LineTerminator LF CR LS PS 7.4 コメント (Comments) Description コメントは、 1 行または複数行になりうる。複数行のコメントはネストできない。 1 行コメントは LineTerminator 以外の任意の文字を含むことが可能であること、またトークンは常に可能な長さである一般規則により、 1 行コメントは常に、マーカー // からその行の終わりまでの全ての文字で構成される。しかし、行末の LineTerminator は 1 行コメントの内容とはみなされない; それは字句文法によって別々に認識され、構文文法の入力要素のストリームの一部となる。この点がとても重要である。というのは、これは 1 行コメントの有無が自動セミコロン挿入 (セクション 7.9) に影響を与えないということを暗に意味するからである。 コメントは空白のように振る舞い、捨てられるが、 MultiLineComment が行終端子文字を含む場合、構文文法による解析を目的としてコメント全体が LineTerminator と考えられる、 Syntax Comment MultiLineComment SingleLineComment MultiLineComment /* MultiLineCommentCharsopt */ MultiLineCommentChars MultiLineNotAsteriskChar MultiLineCommentCharsopt PostAsteriskCommentCharsopt PostAsteriskCommentChars MultiLineNotForwardSlashOrAsteriskChar MultiLineCommentCharsopt PostAsteriskCommentCharsopt MultiLineNotAsteriskChar SourceCharacter but not asterisk * MultiLineNotForwardSlashOrAsteriskChar SourceCharacter but not forward-slash / or asterisk * SingleLineComment SingleLineCommentChars SingleLineCommentChar SingleLineCommentCharsopt SingleLineCommentChar SourceCharacter but not LineTerminator 7.5 トークン (Tokens) Syntax Token ReservedWord Identifier Punctuator NumericLiteral StringLiteral 7.5.1 予約語 (Reserved Words) Description 予約語を識別子として使うことはできない。 Syntax ReservedWord Keyword FutureReservedWord NullLiteral BooleanLiteral 7.5.2 キーワード (Keywords) 次のトークンは ECMAScript キーワードであり、 ECMAScript プログラム中で識別子に使うことはできない。 Syntax Keyword one of break case catch continue default delete do else finally for function if in instanceof new return switch this throw try typeof var void while with 7.5.3 将来の予約語 (Future Reserved Words) 次の語は提出された拡張の中でキーワードとして使用され、その拡張が将来採択される可能性を考え、予約される。 Syntax FutureReservedWord one of abstract boolean byte char class const debugger double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile 7.6 識別子 (Identifiers) Description 識別子は、若干の修正を加えた Unicode 標準 (バージョン 3.0 のセクション 5.16) で与えられる文法に従い解釈される。文法は Unicode 標準により指定される文字カテゴリの規範、及び参考情報の両方に基づいている。 Unicode 標準のバージョン 2.1 に指定されるカテゴリの文字は、全ての適合 ECMAScript 実装によってそれらのカテゴリ内として扱われなければならない; しかしながら、適合 ECMAScript 実装は、 Unicode の後のバージョンでのカテゴリ割り当てに基づく追加の合法的な識別子文字を許可してよい。 この標準は Unicode 標準に与えられる文法からある変更を指定する; ドル記号($) 及びアンダースコア (_) は識別子中のどこでも許される。ドル記号は機械的に生成されるコード中のみの使用を意図される。 Unicode エスケープシーケンスは識別子中でも許され、それは UnicodeEscapeSequence (セクション 7.8.4) の CV により算出されるように、識別子中のその場所に一文字を寄与する。 UnicodeEscapeSequence を使って識別子に不正な文字を設定することはできない。言い換えれば、\ UnicodeEscapeSequence シーケンスが UnicodeEscapeSequence の CV に置換されたら、結果は依然として有効な識別子で、正確に元の Identifier と文字の同じシーケンスなければならない。 Unicode 標準に従い規準的に等価である 2 つの識別子は、コードポイントの厳密に同じシーケンスによって表されない限りは等しくない(言い換えれば、適合 ECMAScript 実装は、識別子上でビット比較を行うことのみを要求される)。入ってくるソーステキストがコンパイラに行く前に正規化形式 C に変換されることを意図する。 Syntax Identifier ReservedWord でない IdentifierName IdentifierName IdentifierStart IdentifierName IdentifierPart IdentifierStart UnicodeLetter $ _ \ UnicodeEscapeSequence IdentifierPart IdentifierStart UnicodeCombiningMark UnicodeDigit UnicodeConnectorPunctuation \ UnicodeEscapeSequence UnicodeLetter Unicode カテゴリ "Uppercase letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", "Letter number (Nl)" 内の任意の文字 UnicodeCombiningMark Unicode カテゴリ "Non-spacing mark (Mn)" または "Combining spacing mark (Mc)" 内の任意の文字 UnicodeDigit Unicode カテゴリ "Decimal number (Nd)" 内の任意の文字 UnicodeConnectorPunctuation Unicode カテゴリ "Connector punctuation (Pc)" 内の任意の文字 UnicodeEscapeSequence セクション 7.8.4 を参照。 HexDigit one of 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F 7.7 区切り子 (Punctuators) Syntax Punctuator one of { } ( ) [ ] . ; , = = == != === !== + - * % ++ -- | ^ ! ~ || ? = += -= *= %= = = = = |= ^= DivPunctuator one of / /= 7.8 リテラル (Literals) Syntax Literal NullLiteral BooleanLiteral NumericLiteral StringLiteral 7.8.1 Null リテラル (Null Literals) Syntax NullLiteral null Semantics null リテラルの値 null は、単独の Null 型の値で null と呼ばれる。 7.8.2 Boolean リテラル (Boolean Literals) Syntax BooleanLiteral true false Semantics Boolean リテラルの値 true は、 Boolean 型の値で true と呼ばれる。 Boolean リテラルの値 false は、Boolean 型の値で false と呼ばれる。 7.8.3 数値リテラル (Numeric Literals) Syntax NumericLiteral DecimalLiteral HexIntegerLiteral DecimalLiteral DecimalIntegerLiteral . DecimalDigitsopt ExponentPartopt . DecimalDigits ExponentPartopt DecimalIntegerLiteral ExponentPartopt DecimalIntegerLiteral 0 NonZeroDigit DecimalDigitsopt DecimalDigits DecimalDigit DecimalDigits DecimalDigit DecimalDigit one of 0 1 2 3 4 5 6 7 8 9 NonZeroDigit one of 1 2 3 4 5 6 7 8 9 ExponentPart ExponentIndicator SignedInteger ExponentIndicator one of e E SignedInteger DecimalDigits DecimalDigits DecimalDigits HexIntegerLiteral 0x HexDigit 0X HexDigit HexIntegerLiteral HexDigit NumericLiteral に直接続くソース文字は、けして IdentifierStart や DecimalDegit ではない。 NOTE 例えば 3in はエラーであり、 3 と in の 2 つの入力要素とはならない。 Semantics 数値リテラルは、 Number 型の値を表す。この値は 2 ステップで判断される まず、数学値 (MV) がリテラルから派生する; 次に、この数学値が、下に述べるように丸められる。 NumericLiteral DecimalLiteral の数学値は、 DecimalLiteral の数学値である。 NumericLiteral HexIntegerLiteral の数学値は、 HexIntegerLiteral の数学値である。 DecimalLiteral DecimalIntegerLiteral . の数学値は、 DecimalIntegerLiteral の数学値である。 DecimalLiteral DecimalIntegerLiteral . DecimalDigits の数学値は、 n を DecimalDigits の文字数として、 DecimalIntegerLiteral の数学値 + (DecimalDigits の数学値 × 10-n) である。 DecimalLiteral DecimalIntegerLiteral . ExponentPart の数学値は、 e を ExponentPart の数学値として DecimalIntegerLiteral の数学値 × 10e である。 DecimalLiteral DecimalIntegerLiteral . DecimalDigits ExponentPart の数学値は、 n を DecimalDigit の文字数、 e を ExponenetPart の数学値として、 (DecimalIntegerLiteral の数学値 + (DecimalDigits の数学値 × 10-n)) × 10e である。 DecimalLiteral . DecimalDigits の数学値は、 n を DecimalDigits の文字数として、 DecimalDigits の数学値 × 10-n である。 DecimalLiteral . DecimalDigits ExponentPart の数学値は、 n を DecimalDigits の文字数、 e を ExponenetPart の数学値として、 DecimalDigits の数学値の 10e-n である。 DecimalLiteral DecimalIntegerLiteral の数学値は、 DecimalIntegerLiteral の数学値である。 DecimalLiteral DecimalIntegerLiteral ExponentPart の数学値は、 e を ExponenetPart の数学値として、 DecimalIntegerLiteral の数学値 × 10e である。 DecimalIntegerLiteral 0 の数学値は、 0 である。 DecimalIntegerLiteral NonZeroDigit DecimalDigits の数学値は、 n を DecimalDigits の文字数として、 (NonZeroDigit の数学値の × 10n) + DecimalDigits の数学値である。 DecimalDigits DecimalDigit の数学値は、 DecimalDigit の数学値である。 DecimalDigits DecimalDigits DecimalDigit の数学値は、 (DecimalDigits の数学値 × 10) + DecimalDigit の数学値である。 ExponentPart ExponentIndicator SignedInteger の数学値は、 SignedInteger の数学値である。 SignedInteger DecimalDigits の数学値は、 DecimalDigits の数学値である。 SignedInteger + DecimalDigits の数学値は、 DecimalDigits の数学値である。 SignedInteger - DecimalDigits の数学値は、負の DecimalDigits の数学値である。 DecimalDigit 0 または HexDigit 0 の数学値は、 0 である。 DecimalDigit 1 または NonZeroDigit 1 または HexDigit 1 の数学値は、 1 である。 DecimalDigit 2 または NonZeroDigit 2 または HexDigit 2 の数学値は、 2 である。 DecimalDigit 3 または NonZeroDigit 3 または HexDigit 3 の数学値は、 3 である。 DecimalDigit 4 または NonZeroDigit 4 または HexDigit 4 の数学値は、 4 である。 DecimalDigit 5 または NonZeroDigit 5 または HexDigit 5 の数学値は、 5 である。 DecimalDigit 6 または NonZeroDigit 6 または HexDigit 6 の数学値は、 6 である。 DecimalDigit 7 または NonZeroDigit 7 または HexDigit 7 の数学値は、 7 である。 DecimalDigit 8 または NonZeroDigit 8 または HexDigit 8 の数学値は、 8 である。 DecimalDigit 9 または NonZeroDigit 9 または HexDigit 9 の数学値は、 9 である。 HexDigit a または HexDigit A の数学値は、 10 である。 HexDigit b または HexDigit B の数学値は、 11 である。 HexDigit c または HexDigit C の数学値は、 12 である。 HexDigit d または HexDigit D の数学値は、 13 である。 HexDigit e または HexDigit E の数学値は、 14 である。 HexDigit f または HexDigit F の数学値は、 15 である。 HexIntegerLiteral 0x HexDigit の数学値は、 HexDigit の数学値である。 HexIntegerLiteral 0X HexDigit の数学値は、 HexDigit の数学値である。 HexIntegerLiteral HexIntegerLiteral HexDigit の数学値は、 (HexIntegerLiteral の数学値 × 16) + HexDigit の数学値である。 一旦数値リテラルの厳密な数学値が決定されたら、 Number 型の値に丸められる。数学値が 0 ならば、丸められる値は +0 である; そうではなく、リテラルが DecimalLiteral でなくそのリテラルが 20 を超える有効数字数\でなければ、数値が 20 番目以降の各有効数字を数字 0 へ置換して生成されるリテラルの数学値の数値、または 20 番目以降の各有効数字を数字 0 に置換して生成されるリテラルの数学値の数値、そして 20 番目の有効数字の位置のリテラルの増加、のいずれかでありえる場合、丸められる値は (セクション 8.5 で定義される意味の) 数学値の数値でなければならない。数字はそれが ExponentPart の一部\でなく次の二点のどちらかであれば有効数字 (significant) である。 0 でない。 その左側が 0 以外の数字でその右側が 0 以外の数字で ExponentPart 内でない。 7.8.4 文字列リテラル (String Literals) 文字列リテラルは、単引用符または二重引用符で囲まれた 0 個以上の文字である。各文字はエスケープシーケンスによって表されてもよい。 Syntax StringLiteral " DoubleStringCharactersopt " SingleStringCharactersopt DoubleStringCharacters DoubleStringCharacter DoubleStringCharactersopt SingleStringCharacters SingleStringCharacter SingleStringCharactersopt DoubleStringCharacter SourceCharacter but not double-quote " or backslash \ or LineTerminator \ EscapeSequence SingleStringCharacter SourceCharacter but not single-quote or backslash \ or LineTerminator \ EscapeSequence EscapeSequence CharacterEscapeSequence 0 [lookahead ∉ DecimalDigit] HexEscapeSequence UnicodeEscapeSequence CharacterEscapeSequence SingleEscapeCharacter NonEscapeCharacter SingleEscapeCharacter one of " \ b f n r t v NonEscapeCharacter SourceCharacter but not EscapeCharacter or LineTerminator EscapeCharacter SingleEscapeCharacter DecimalDigit x u HexEscapeSequence x HexDigit HexDigit UnicodeEscapeSequence u HexDigit HexDigit HexDigit HexDigit 非終端記号 HexDigit の定義は、セクション 7.8.3 に与える。 SourceCharacter はセクション 2 及び 6 で述べる。 文字列リテラルは String 型の値を表す。リテラルの文字列値 (SV) は、文字列値の様々な部分に寄与する文字値 (CV) に関して記述される。この処理の一部として、文字列リテラル内部のいくつかの文字は、セクション 7.8.3 に述べる数学値 (MV) を持つものとして解釈される。 StringLiteral "" の文字列値は、空の文字シーケンスである。 StringLiteral の文字列値は、空の文字シーケンスである。 StringLiteral " DoubleStringCharacters " の文字列値は、DoubleStringCharacters の文字列値である。 StringLiteral SingleStringCharacters の文字列値は、SingleStringCharacters の文字列値である。 DoubleStringCharacters DoubleStringCharacter の文字列値は、1 文字のシーケンスで、 DoubleStringCharacter の文字値である。 DoubleStringCharacters DoubleStringCharacter DoubleStringCharacters の文字列値は、順に DoubleStringCharacters の文字列値内の全ての文字の続く DoubleStringCharacter の文字値のシーケンスである。 SingleStringCharacters SingleStringCharacter の文字列値は、1 文字のシーケンスで、 SingleStringCharacter の文字値である。 SingleStringCharacters SingleStringCharacter SingleStringCharacters の文字列値は、順に SingleStringCharacters の文字列値内の全ての文字の続く SingleStringCharacter の文字値のシーケンスである。 DoubleStringCharacter SourceCharacter but not 二重引用符 " or バックスラッシュ \ or LineTerminator の文字値は、 SourceCharacter 文字それ自身である。 DoubleStringCharacter \ EscapeSequence の文字値は、 EscapeSequence の文字値である。 SingleStringCharacter SourceCharacter but not 単引用符 or バッククラッシュ \ or LineTerminator の文字値は、 SourceCharacter 文字それ自身である。 SingleStringCharacter \ EscapeSequence の文字値は、 EscapeSequence の文字値である。 EscapeSequence CharacterEscapeSequence の文字値は、 CharacterEscapeSequence の文字値である。 EscapeSequence 0 [lookahead ∉ DecimalDigit] の文字値は、 NUL 文字 (Unicode 値 0000) である。 EscapeSequence HexEscapeSequence の文字値は、 HexEscapeSequence の文字値である。 EscapeSequence UnicodeEscapeSequence の文字値は、 UnicodeEscapeSequence の文字値である。 CharacterEscapeSequence SingleEscapeCharacter の文字値は、次の表に従い SingleEscapeCharacter に決定されるコードポイント値の文字である Escape SequenceCode Point ValueNameSymbol \b\u0008backspace BS \t\u0009horizontal tab HT \n\u000Aline feed (new line) LF \v\u000Bvertical tab VT \f\u000Cform feed FF \r\u000Dcarriage return CR \"\u0022double quote" \ \u0027single quote \\\u005Cbackslash\ CharacterEscapeSequence NonEscapeCharacter の文字値は、 NonEscapeCharacter の文字値である。 NonEscapeCharacter SourceCharacter but not EscapeCharacter or LineTerminator の文字値は、 SourceCharacter 文字それ自身である。 HexEscapeSequence x HexDigit HexDigit の文字値は、コードポイント値が (16 × 最初の HexDigit の数学値) + 2番目の HexDigit の数学値 である文字である。 UnicodeEscapeSequence u HexDigit HexDigit HexDigit HexDigit の文字値は、コードポイント値が (4096 (すなわち 163) × 最初の HexDigit の数学値) + (256 (すなわち 162) × 2 番目の HexDigit の数学値) + (16 × 3 番目の HexDigit の数学値) + 4 番目の HexDigit の数学値 である文字である。 NOTE 文字 LineTerminator は、それにバックスラッシュ \ を先行させても、文字列リテラル内には出現できない。 行終端子文字を文字列リテラルの文字列地の一部に置く妥当な方法は、 \n や \u000A のようなエスケープシーケンスを用いることである。 7.8.5 正規表現リテラル (Regular Expression Literals) 正規表現リテラルは走査時に RegExp オブジェクト (セクション 15.10) に変換される入力要素である。オブジェクトはそれを含むプログラムまた関数の評価の開始前に生成される。リテラル評価はそのオブジェクトへの参照を生成する; それは新規オブジェクト生成はしない。プログラム内の 2 つの正規表現リテラルは、2 つのリテラルの内容がまったく同じであっても、互いに === として比較しない正規表現オブジェクトに評価する。 RegExp オブジェクトは、 new RegExp (セクション 15.10.4) や関数としての RegExp コンストラクタ呼出し (セクション 15.10.3) によって実行時に生成されてもよい。 下の生成規則は正規表現リテラルの構文を記述し、正規表現リテラルの終了の検出に入力要素走査から使用される。 RegularExpressionBody 及び RegularExpressionFlags を構成する文字の文字列は、それ自身がより厳重な文法でそれらを解釈する正規表現コンストラクタに、未解釈で渡される。実装は正規表現コンストラクタの文法を拡張してよいが、 RegularExpressionBody 及び RegularExpressionFlags 生成規則、またはこれらの生成規則によって使用される生成規則を拡張すべきではない。 Syntax RegularExpressionLiteral / RegularExpressionBody / RegularExpressionFlags RegularExpressionBody RegularExpressionFirstChar RegularExpressionChars RegularExpressionChars [empty] RegularExpressionChars RegularExpressionChar RegularExpressionFirstChar NonTerminator but not * or \ or / BackslashSequence RegularExpressionChar NonTerminator but not \ or / BackslashSequence BackslashSequence \ NonTerminator NonTerminator SourceCharacter but not LineTerminator RegularExpressionFlags [empty] RegularExpressionFlags IdentifierPart NOTE 正規表現リテラルは空にはならない; 空の正規表現リテラルをあらわす代わりに、文字 // は 1 行コメントを開始する。空の正規表現を指定するには、 /(? )/ を用いる。 Semantics 正規表現リテラルは Object 型の値を表す。この値は 2 ステップで決定される まず、正規表現の RegularExpressionBody 及び RegularExpressionFlags 生成規則拡張を構成する文字が、それぞれ 2 つの文字列の Pattern と Flags に解析されずに集められる。そして new RegExp コンストラクタが 2 つの引数 Pattern と Flags で呼出され、結果は RegularExpressionLiteral の値となる。 new RegExp 呼出しがエラーを生成するならば、実装は、自由裁量で、プログラム走査中に直ちにエラー報告してもよいし、プログラム実行中に正規表現リテラルが評価されるまでエラーを延期してもよい。 7.9 自動セミコロン挿入 (Automatic Semicolon Insertion) ある種の ECMAScript 文 (空文 (empty statement), 変数文 (variable statement), 式文 (expression statement), do-while 文 (do-while statement), continue 文 (continue statement), break 文 (break statement), return 文 (return statement), turhow 文 (throw statement)) はセミコロンで終了しなければならない。そのようなセミコロンは、ソーステキスト内に常に明示的に出現してよい。しかしながら、簡単にするために、ある位置ではソーステキストからセミコロンを省略してよい。この位置は、それらの位置のソースコードトークンのストリームにセミコロンが自動的に挿入されるという言葉で説明される。 7.9.1 自動セミコロン挿入規則 (Rules of Automatic Semicolon Insertion) プログラムが左から右へと解析され、文法の任意の生成規則によって許可されないトークン (違反トークン (offending token) と呼ばれる) に遭遇するとき、次の条件に 1 つ以上当てはまる場合、違反トークンの前にセミコロンが自動的に挿入される。 1. 違反トークンが、少なくとも 1 つの LineTerminator で、前のトークンから分離されている。 2. 違反トークンが、 } である。 プログラムが左から右へと解析され、トークンの入力ストリームが終了し、解析器が入力トークンストリームを一つの完全な ECMAScript Program として解析できないとき、入力ストリームの末尾にセミコロンが自動的に挿入される。 プログラムが左から右へと解析され、文法の任意の生成規則によって許可されないトークンに遭遇するが、その生成規則が限定生成規則 (resutricted production) であり、限定生成規則内部\で注記 "[no LineTerminator here]" にすぐ続く終端記号または非終端記号の最初のトークン (そのためこのようなトークンは限定トークン (restricted token) と呼ばれる) であり、そして限定トークンが少なくとも 1 つの LineTerminator で前のトークンから分離されているとき、限定トークンの前にセミコロンが自動的に挿入される。 とはいえ、以上の規則を上書きする条件を追加する セミコロンが結果として空文として解析される場合、またセミコロンが for 文 (セクション 12.6.3) のヘッダ内の 2 つのセミコロンの一つになる場合は、セミコロンは自動的に挿入されない。 NOTE 文法における限定生成規則は下記のみである PostfixExpression LeftHandSideExpression [LineTerminator 無し] ++ LeftHandSideExpression [LineTerminator 無し] -- ContinueStatement continue [LineTerminator 無し] Identifieropt ; BreakStatement break [LineTerminator 無し] Identifieropt ; ReturnStatement return [LineTerminator 無し] Expressionopt ; ThrowStatement throw [LineTerminator 無し] Expression ; これらの限定生成規則の実際の効果は、次のとおりである 解析器がそれを後置演算子として扱う場所に ++, -- トークンが出現し、少なくとも一つ以上の LineTerminator が前のトークンと ++, -- トークンの間に出現するとき, セミコロンが ++, -- トークンの前に自動的に挿入される。 continue, break, return, throw トークンが出現し、次のトークンの前に LineTerminator が出現するとき、セミコロンは continue, break, return, throw トークンの後に自動的に挿入される。 ECMAScript プログラマへの結果的な実用的助言は 後置 ++ 演算子、また後置 -- 演算子は、項と同じ行に出現するべきである。 return 文、また throw 文中の Expression は、return トークンまた throw トークンと同じ行で開始するべきである。 break 文、また continue 文のラベルは、 break トークンまた continue トークンと同じ行にあるべきである。 7.9.2 自動セミコロン挿入例 (Examples of Automatic Semicolon Insertion) 次のソース { 1 2 } 3 は、ECMAScript 文法において、自動セミコロン挿入規則を以ってしても有効な文ではない。 対照的に、このソース { 1 2 } 3 もまた有効な ECMAScript 文ではないが、自動セミコロン挿入によって次のように変換される { 1 ;2 ;} 3; これは有効な ECMAScript 文である。 ソース for (a; b ) は有効な ECMAScript 文ではなく、自動セミコロン挿入によって変更されない。セミコロンが for 文のヘッダに要求されるからである。自動セミコロン挿入が for 文のヘッダ内の 2 つのセミコロンの 1 つを挿入することはない。 ソース return a + b は自動セミコロン挿入によって次のように変換される return; a + b; NOTE 式 a + b は、 return 文によって返される値として扱われない。return トークンから LineTerminator で分離されているからである。 ソース a = b c は自動セミコロン挿入によって次のように変換される a = b; c; NOTE トークン ++ は、変数 b に適用される後置演算子として扱われない。 b と ++ の間に LineTerminator があるからである。 ソース if (a b) else c = d は有効な ECMAScript 文ではなく、その位置に適用する文法の生成規則がないとしても、 else トークンの前への自動セミコロン挿入によって変更されない。自動セミコロン挿入が空文として解析されるからである。 ソース a = b + c (d + e).print() は自動セミコロン挿入によって変換されない。 2 行目の括弧式 () は関数呼び出しの引数リストとして解釈できるからである。 a = b + c(d + e).print() 代入文が左括弧で開始しなければならない状況では、自動セミコロン挿入を信頼するより、先行する文の末尾に明示的なセミコロンを提供する方が、プログラマにとってよい発想である。
https://w.atwiki.jp/kamikazepara/pages/20.html
KP.comファンクラブのご案内 ファンクラブ入会方法 ファンクラブに入会すると、コンサートチケット(未定)の優先申込や会報(不定期)の発行など得点が受けられます。 会員特典 ○会員証の発行 ○会報の発行(不定期発行) ○コンサートチケット他、出来る限りのチケット優先申込 ○伝言板サービス(会報では間に合わない最新情報をメールまたはハガキでご案内します。) 会費 入会金100,000円+年会費1,000,000円 合計1,100,000円(税込) ご入会方法 Skype,LINE,E-mailを利用し入会する方法 現在対応しておりません。順次対応していくつもりです。ご了承ください。 郵便ハガキを利用し入会する方法 KP.comの家がありません。住所がないので郵便ハガキを受け取ることが出来ません。ご了承ください。 ご注意 (1)冗談半分での入会申請はご遠慮ください。 (2)入金はなるべく早めにお願いします。生活苦しいです。 (3)ホントお金下さい。 (4)助けてください。 お問い合わせ先 Twitter Com7t(削除) LINE 秘密♡ Skype ひ・み・つ♡ KP.com
https://w.atwiki.jp/bgmfes/pages/36.html
ねんどろいど ぷち B.G.M Festivalセット vol.0 3,500円 B.G.M Festival Official Tシャツ(black、white、orange)各3,000円 B.G.M Festival Official パーカー 6,000円 B.G.M Festival Official メッセンジャーバッグ 8,000円 B.G.M Festival Official キャンパスバッグ 2,500円 B.G.M Festival Official ワッペン 1,200円 B.G.M Festival Official 着脱式ワッペン 1,600円 B.G.M Festival Official マフラータオル 2,000円 B.G.M Festival Official リストバンド 1,500円 他メーカー、コスパ商品など
https://w.atwiki.jp/ohden/pages/267.html
Apache2+SSL 環境 Ubuntu 8.10 Apache 2.2.14 OpenSSL 0.9.8k 当たり前じゃが、Apache2がinstall済みであることが前提。 Apacheのインストール OpenSSLとmodsslのinstall。 ※最近下のapt-get使ったらどっちも無いって言われた...が、apache-ssl moduleは入っとるっぽぃ。Apache入れた段階で一緒に入るようになったんかな? sudo apt-get install ssl sudo apt-get install apache-ssl Apache-SSLモジュールを有効にする。 sudo a2enmod ssl Enabling module ssl.See /usr/share/doc/apache2.2-common/README.Debian.gz on how to configure SSL and create self-signed certificates.Run /etc/init.d/apache2 restart to activate new configuration! SSL使用portの設定。 cd /etc/apache2/ sudo vi ports.conf 中を見て、mod_sslに対する記述が無かったら以下を追記する。 IfModule mod_ssl.c Listen 443 /IfModule ports.confの中にはこんなんもあるんじゃが...これは何なんじゃろうか? IfModule mod_gnutls.c Listen 443 /IfModule GnuTLSって事はGnuのTLS moduleの参照らしいが...まぁ、わからんので放置。 証明書と秘密鍵を作る。 sudo mkdir ssl cd ssl sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf ./apache.pem ※証明書を作り直して、その証明書を有効にしようと思うたらapacheの再起動が必要。 commonNameを設定。 [Tab]キー押下で『了解』へ移動し[Enter]キー押下で設定 出来上がった証明書はtext fileなので閲覧が可能。 sudo vi apache.pem 見てみると 『-----BEGIN RSA PRIVATE KEY-----』~『-----END RSA PRIVATE KEY-----』のエリアと 『-----BEGIN CERTIFICATE-----』~『-----END CERTIFICATE-----』エリアに分かれてると分かる。 それぞれ秘密鍵と証明書。 cd /etc/apache2/sites-available/ sudo vi default-ssl 50行目辺りに『SSLCertificateFile』『SSLCertificateKeyFile』の項目があるので、その項目をコメントアウト(行頭に『#』を付ける)し、以下の1行を追加する。 SSLCertificateFile /etc/apache2/ssl/apache.pem#SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem#SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key ※行頭#で始まっとる下2行はうちの環境にたまたまあった『SSLCertificateFile』『SSLCertificateKeyFile』の項目ね。環境によって違うと思う。 『SSLCertificateFile』は証明書fileを指定する項目で、『SSLCertificateKeyFile』は秘密鍵を指定する項目。 で、その2項目をコメントアウトして『SSLCertificateFile』だけにしてるのは、さっき作成したapache.pemの中に証明書も秘密鍵も入ってるから。apacheが使いたい方だけを読み込んで使ってくれるらしい。 ※今回は『make-ssl-cert』を使ったが、OpenSSLとか使ってもできるらしい。やってないのでまた今度。 sudo a2ensite default-ssl Enabling site default-ssl.Run /etc/init.d/apache2 reload to activate new configuration! sudo /etc/init.d/apache2 restart * Restarting web server apache2 apache2 Could not reliably determine the server s fully qualified domain name, using 127.0.1.1 for ServerName... waiting .apache2 Could not reliably determine the server s fully qualified domain name, using 127.0.1.1 for ServerName[ OK ] 再起動できたら、ブラウザでアクセスしてみる。 https //localhost ※httpsなのを忘れないように。 アクセスすると認証ダイアログが表示される。 勝手に作った証明書なので、当然怪しいって言われるけど気にしない。w 気になる人はお金払って証明書買って下さい。(ノ∀`) あ、そぉそぉ。 証明書作成時に入力したcommonNameってのはココに表示されるんよね。 更新日: 2010年11月11日 (木) 13時38分22秒